data segment
   addr dw 76A3H
   COUNT DW (?)
   hex db '0123456789ABCDEF','$'
DATA ENDS
 CODE SEGMENT
     ASSUME CS:CODE,DS:DATA
  START:   MOV AX,DATA
           MOV DS,AX
           MOV CX,0
           LEA SI,ADDR
           XOR AX,AX
           MOV AX,[SI]
   AA1:    TEST AX,0FFFFH
           JZ AA3
           JNS AA2
           INC CX
  AA2:     SHL AX,1
           JMP AA1
  AA3:     MOV COUNT,CX
           MOV AX,COUNT
           MOV BX,OFFSET HEX
           XLAT
           MOV DL,AL
           MOV AH,02H
           INT 21H
           MOV AH,4CH
           INT 21H
 CODE ENDS
      END START
